package com.apexedu.biz.action;

import com.apexedu.biz.entity.TAccessAppReg;
import com.apexedu.biz.service.impl.BusinessTabButServiceImpl;
import com.apexedu.biz.service.impl.BusinessTabServiceImpl;
import com.apexedu.biz.util.StringInfoUtil;
import com.apexedu.framework.service.BaseService;
import com.apexedu.identity.entity.TSysMenu;
import com.apexedu.identity.entity.TSysRole;
import com.apexedu.identity.entity.TSysRoleMenuButton;
import com.apexedu.sys.entity.ApplicationEnum;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * 业务系统IFRAME页面的操作
 * User: Administrator
 * Date: 14-4-17
 * Time: 下午2:54
 * To change this template use File | Settings | File Templates.
 */
@Component
@Scope("prototype")
public class BusinessTabButAction extends BizBaseAction implements StringInfoUtil{
    /**
     * 希望类的不同版本对序列化兼容，只要确保类的不同版本具有相同的serialVersionUID
     */
    @Resource(name = "businessTabButService")
    public void setBaseService(BaseService baseService) {
        super.setBaseService(baseService);
    }

    private TSysRole tsysRole;

    private List<ApplicationEnum> listMenuDepth2; // 遍历二级菜单

    private List<TAccessAppReg> listApp; //业务系统列表

    private String appid; //业务系统id

    private List<TSysRole> tsysRoles;//角色列表

    private String no;//业务系统标示

    private String menuebuttons;

    private String menues;

    private String defaultMenuid;

    private String type;

    private int rownum;//该业务系统下有多少条角色

    public void setTsysRole(TSysRole tsysRole) {
        this.tsysRole = tsysRole;
    }

    public void setAppid(String appid) {
        this.appid = appid;
    }

    public void setListApp(List<TAccessAppReg> listApp) {
        this.listApp = listApp;
    }

    public void setListMenuDepth2(List<ApplicationEnum> listMenuDepth2) {
        this.listMenuDepth2 = listMenuDepth2;
    }

    public TSysRole getTsysRole() {
        return tsysRole;
    }

    public List<TAccessAppReg> getListApp() {
        return listApp;
    }

    public List<ApplicationEnum> getListMenuDepth2() {
        return listMenuDepth2;
    }

    public String getAppid() {
        return appid;
    }

    public List<TSysRole> getTsysRoles() {
        return tsysRoles;
    }

    public void setTsysRoles(List<TSysRole> tsysRoles) {
        this.tsysRoles = tsysRoles;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getMenuebuttons() {
        return menuebuttons;
    }

    public void setMenuebuttons(String menuebuttons) {
        this.menuebuttons = menuebuttons;
    }

    public String getMenues() {
        return menues;
    }

    public void setMenues(String menues) {
        this.menues = menues;
    }

    public String getDefaultMenuid() {
        return defaultMenuid;
    }

    public void setDefaultMenuid(String defaultMenuid) {
        this.defaultMenuid = defaultMenuid;
    }

    public int getRownum() {
        return rownum;
    }

    public void setRownum(int rownum) {
        this.rownum = rownum;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    /**
     * 复制角色信息
     *
     * @return
     */
        public String copyRole() {
        String app = getRequest().getParameter(AUC_APPID);//获取系统接入号
        String roleId = getRequest().getParameter(AUC_ROLEID);//获取角色编号
        BusinessTabButServiceImpl service = (BusinessTabButServiceImpl) this.getBaseService();
        service.getRoleMenu(this, app, roleId);
        return toView("input.jsp");
    }
}
